package com.genesis.yunnanji.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.genesis.yunnanji.R;
import com.genesis.yunnanji.bean.ExplorationRoomBean;
import com.genesis.yunnanji.config.GenesisApiConfig;

import java.util.List;

/**
 * 创建日期：2018/10/30 0030
 * 作者：Kite
 * 描述：
 */
public class TwoAdapter extends BaseQuickAdapter<ExplorationRoomBean.ResultBean.ListBean.DataBean, BaseViewHolder> {

    private Context mContext;

    public TwoAdapter(Context mContext, int layoutResId, @Nullable List<ExplorationRoomBean.ResultBean.ListBean.DataBean> data) {
        super(layoutResId, data);
        this.mContext = mContext;
    }

    @Override
    protected void convert(BaseViewHolder helper, ExplorationRoomBean.ResultBean.ListBean.DataBean item) {
        Glide.with(mContext).load(GenesisApiConfig.PIC_HOST + item.getCover_img()).into((ImageView) helper.getView(R.id.iv_supitem_iv));
        helper.setText(R.id.tv_supitem_title, item.getTitle());
        helper.setText(R.id.tv_supitem_address, item.getAddress());
        helper.setText(R.id.tv_supitem_phone, item.getPhone());
    }

}
